python read file to variable

28

python read file to variable -

with open('data.txt', 'r') as file:
    data = file.read().replace('\n', '')

Comments

Submit
0 Comments